//CWE-1276 Consider the example Locked_override_register example. 
/*
Many SoCs use hardware to partition system resources between trusted and un-trusted entities.
One example of this concept is the Arm TrustZone, in which the processor and all security-aware IP attempt to isolate resources based on the status of a privilege bit. This privilege bit is part of the input interface in all TrustZone-aware IP. If this privilege bit is accidentally grounded or left unconnected when the IP is instantiated, 
privilege escalation of all input data may occur.
*/
module soc(clk, rst_n, rdata, rdata_security_level, data_out);
input clk, rst_n, rdata_security_level;
input [31:0] rdata;
output [31:0] data_out;
tz_peripheral u_tz_peripheral(
.clk(clk),
.reset(rst_n),
.data_in(rdata),
//Copy-and-paste error or typo grounds data_in_security_level (in this example 0=secure, 1=non-secure) effectively promoting all data to "secure")
.data_in_security_level(1'b0),
//.data_in_security_level(data_in_security_level),
.data_out(data_out)
);
endmodule
// Instantiation of IP in a parent system
module tz_peripheral(clk, reset, data_in, data_in_security_level, data_out);
input clk, reset;
input [31:0] data_in;
input data_in_security_level;
output data_out;
always @(posedge clk or negedge reset)begin
    if(~reset) data_out <= 0;
    else if(data_in_security_level==1'b0) data_out <= data_in;
    else data_out <= data_out;
end
always @(posedge clk)begin
    cover(data_in_security_level==1);//mode prove->mode cover
end
endmodule